package com.smile.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smile.model.domain.CountFlight;
import com.smile.model.domain.FeisuanDrone;
import com.smile.model.domain.ModelType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DroneMapper extends BaseMapper<FeisuanDrone> {

    //机型占比统计
    @Select("select g.num as count,g.model_id as modelId,m.model_name as modelName,g.device_model_key as deviceModelKey from (select count(*) as num,model_id,device_model_key from feisuan_drone where delete_status = 0 GROUP BY model_id ORDER BY   num desc) as g left JOIN feisuan_device_model as m on m.id = g.model_id")
    List<ModelType> modelType();
}
